package com.huawei.appgallery.appcomment.ui;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.widget.RatingBar;
import android.widget.TextView;
import com.huawei.appgallery.appcomment.ui.view.AddCommentTitle;
import com.huawei.appgallery.appcomment.ui.view.AddCommentTitle.a;
import com.huawei.appgallery.foundation.ui.framework.widget.MaskImageView;
import com.huawei.secure.android.common.intent.SafeIntent;
import huawei.widget.HwCounterTextLayout;
import huawei.widget.HwEditText;
import huawei.widget.HwTextView;
import o.bcb;
import o.bcg.d;
import o.bcg.e;
import o.bcg.h;
import o.bck;
import o.bdw;
import o.bmt;
import o.cdz;
import o.ckv;
import o.epv;
import o.eqx;

public class CommentActivity extends Activity implements bck, a {
    private HwTextView ˊ;
    private MaskImageView ˋ;
    private bdw ˎ;
    private RatingBar ˏ;
    private HwEditText ॱ;
    private TextView ॱॱ;

    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        requestWindowFeature(1);
        setContentView(d.ˎ);
        this.ˎ = new bdw(this, this, this);
        ˊ();
        this.ˎ.ˊ(new SafeIntent(getIntent()));
    }

    private void ˊ() {
        AddCommentTitle addCommentTitle = (AddCommentTitle) findViewById(e.ॱ);
        this.ˎ.ˊ(addCommentTitle);
        ((HwCounterTextLayout) findViewById(e.ʼᐝ)).setPaddingRelative(epv.ˋ((Context) this, 16), 0, epv.ˋ((Context) this, 16), 0);
        this.ˊ = (HwTextView) findViewById(e.ᶥ);
        this.ˋ = (MaskImageView) findViewById(e.ꜟ);
        this.ˋ.setCornerType(2);
        this.ˋ.ॱ(1);
        this.ॱ = (HwEditText) findViewById(e.ﾞ);
        this.ˏ = (RatingBar) findViewById(e.ʻˊ);
        this.ॱॱ = (TextView) findViewById(e.ʽᐝ);
        if (cdz.ˏ()) {
            findViewById(e.ꞌ).setVisibility(8);
        } else {
            findViewById(e.ꞌ).setVisibility(0);
        }
        ˎ();
        this.ˎ.ॱ(this.ˏ);
        this.ˎ.ˎ(this.ॱ);
        addCommentTitle.setOnTitleClickListener(this);
        addCommentTitle.setCommentContent(getString(h.ˋ));
    }

    private void ˎ() {
        this.ॱ.setFocusable(true);
        this.ॱ.setFocusableInTouchMode(true);
        this.ॱ.requestFocus();
        getWindow().setSoftInputMode(5);
    }

    public void ˎ(String str) {
        this.ॱ.setHint(str);
    }

    public void ॱ(String str) {
        this.ˊ.setText(str);
    }

    public void ˋ(String str) {
        eqx.ˏ(this.ˋ, str, "app_default_icon");
    }

    public void ˊ(String str) {
        this.ॱॱ.setText(str);
    }

    public void ˏ(String str) {
        this.ॱ.setText(str);
    }

    public void ˋ() {
        finish();
    }

    public void ॱ() {
        if (!bmt.ˊ(this)) {
            ckv.ˎ(getString(h.ᐝʽ), 0);
        } else if (this.ˏ.getRating() <= 0.0f) {
            ckv.ˎ(getString(h.ˏˏ), 0);
        } else {
            this.ˎ.ˋ();
        }
    }

    protected void onDestroy() {
        super.onDestroy();
        this.ˎ.ˎ();
    }

    public void ˏ(int i) {
        bcb.ˋ.ˋ("CommentActivity", "resultCode=" + i);
        setResult(i);
    }
}
